-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(product): add uri resolver #1472
feat(product): add uri resolver #1472
Conversation
How exactly is this intended to be used? Because the app dev won't know what kind of url the user will give them (either domain/product/id or domain/product/product-name.html). I would expect that a common resolver would be needed to determine what kind of url is used, then that resolver could call productIdResolver.resolve or productUrlResolver.resolve. Is there another plan to handle this? |
That's exactly how it works: https://github.com/graycoreio/daffodil/blob/develop/libs/external-router/routing/src/guard/existence.guard.ts |
Although the guard doesn't directly call the resolver, it adds a route to a specific place in the config and then that presumably is sufficient to invoke the correct resolver. |
Looks to me like the ExistenceGuard just double checks that the wildcard route it is given is resolvable with the backend platform. It then either proceeds with the same route, or changes the route to a predefined "failed resolution path". I think that's all it does. I don't see what these resolvers have to do with that guard. If the route being resolved was of the form |
@lderrickable hang on I'll write a guide. I should have already done this TBH. |
@griest024 With the setup outlined in the docs, how would it handle this route: Maybe something like this?
|
actually, I'm not sure that would work, since the existence guard/resolver service would make the "resolvable route" a known route and therefore it wouldn't be caught by the |
@lderrickable I'm not sure exactly what your question is. If you're referring to the use case of putting routes in nested trees, that is supported by Note that |
lgtm |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Other information
Fixes #1471